<?php 

class NominacionForm extends sfForm
{
	public function configure()
	{
		$widget = new sfWidgetFormChoice( array('choices' => array() ));
		$widget->setOption('renderer_class', 'sfWidgetFormJQueryAutocompleter');
		$widget->setOption('renderer_options', array(
  			'url'   => $this->getOption('url'),
		));
		$this->setWidgets(array(
			'nominado' => $widget ,
			'archivo' => new sfWidgetFormInputFile(),			
		));
	    
	    $this->setValidator('archivo',new sfValidatorFile(array('required' => false, 'max_size' => 122400, 'mime_types' => 'web_images','path' => sfConfig::get('sf_upload_dir'))));
		$this->setValidator('nominado', new sfValidatorString( array('required' => true )));
	    
	    //$this->widgetSchema->setNameFormat('nominado[%s]');
	    $this->widgetSchema->setLabel('archivo','Foto (opcional):');
	}
}